{%include file="index.header.tpl.php"%}
{%include file="index.left.tpl.php"%}
  <!--主要内容开始-->
  <div class="content-wrapper">
    <section class="content">
      <div class="row">
        <!--树状图-->
        <section class="col-lg-2 connectedSortable" style="padding-right:0;">
         <div class="sidebar" style="background-color:#fff; padding-bottom:0px;">
             <ul class="sidebar-menu" id="chan">
					{%foreach from=$grade_lists key=key item=value%}
                    <li class="treeview {%if $grade_id==$value.grade_id%}active{%/if%}">
                      <a href="index.php?a=score.tpupdate&grade_id={%$value.grade_id%}"> <i class="glyphicon glyphicon-align-left"></i> <span>{%$value.grade_name%}</span>  </a>    
                    </li>
					{%/foreach%}
              </ul>
            </div>
          
        </section>
        <!--树状图结束-->
        <section class="col-lg-10 connectedSortable">
         <div class="box box-default box-solid">
             <form action="" method="post">	
                <div class="box-header with-border">
                    <a href="index.php?a=score.tpupdate&grade_id={%$grade_id%}&tp_type=1" class="btn btn-primary btn-sm">上级表模</a>
                    <a href="index.php?a=score.tpupdate&grade_id={%$grade_id%}&tp_type=2" class="btn btn-default btn-sm">校内报模</a>
                </div>
                <div class="box-body">
                      <div class="form-group">
						  <label class="col-md-1 control-label" style="padding:0; width:110px;">
							   模板名称：
						  </label>
						  <div class="col-md-3 col-sm-3 col-xs-4">
							    <select class="form-control" name="subject_id">
                                    <option value="all">总分</option>
								{%foreach from=$subject_lists key=key item=value%}
                                     <option value="{%$value.subject_id%}">{%$value.subject_name%}</option>
								{%/foreach%}
                                </select>
						   </div>
                            <div class="input-group col-md-3 col-xs-4">
							   <select class="form-control" name="exam_id">
								{%foreach from=$exam_lists key=key item=value%}
                                     <option value="{%$value.exam_id%}">{%$value.exam_name%}</option>
								{%/foreach%}
                                </select>
						   </div> 
				      </div> 
                      <div class="form-group">
						  <label class="col-md-12 control-label"  style="padding:0">
							   统计表设置：
						  </label>
                          <div class="col-md-6 col-sm-6 col-xs-12">
                                 <table class="table table-bordered" id="mytable">
                                     <thead>
                                           <tr>
                                               <td width="100">选择</td>
                                               <td width="100">顺序</td>
                                               <td>项目</td>
                                           </tr>
                                      </thead>
                                       <tr>
                                           <td><input type="checkbox" name="stat_班级" value='1'></td>
                                           <td><input type="text" size="8" name="statorder_班级" value=""></td>
                                           <td>班级</td>
                                       </tr>
                                       <tr>
                                           <td><input type="checkbox" name="stat_期初人数" value='1'></td>
                                           <td><input type="text" size="8" name="statorder_期初人数" value=""></td>
                                           <td>期初人数</td>                                       
                                       </tr>
                                       <tr>
                                           <td><input type="checkbox" name="stat_与考人数" value='1'></td>
                                           <td><input type="text" size="8" name="statorder_与考人数" value=""></td>
                                           <td>与考人数</td>                                       
                                       </tr>
                                       <tr>
                                           <td><input type="checkbox" name="stat_与考率" value='1'></td>
                                           <td><input type="text" size="8" name="statorder_与考率" value=""></td>
                                           <td>与考率</td>                                       
                                       </tr>
                                       <tr>
                                           <td><input type="checkbox" name="stat_总分" value='1'></td>
                                           <td><input type="text" size="8" name="statorder_总分" value=""></td>
                                           <td>总分</td>                                       
                                       </tr>
                                       <tr>
                                           <td><input type="checkbox" name="stat_平均分" value='1'></td>
                                           <td><input type="text" size="8" name="statorder_平均分" value=""></td>
                                           <td>平均分</td>                                       
                                       </tr>
                                       <tr>
                                           <td><input type="checkbox" name="stat_最高分" value='1'></td>
                                           <td><input type="text" size="8" name="statorder_最高分" value=""></td>
                                           <td>最高分</td>                                       
                                       </tr>
                                       <tr>
                                           <td><input type="checkbox" name="stat_最低分" value='1'></td>
                                           <td><input type="text" size="8" name="statorder_最低分" value=""></td>
                                           <td>最低分</td>                                       
                                       </tr>
                                       <tr>
                                           <td><input type="checkbox" name="stat_优秀人数" value='1'></td>
                                           <td><input type="text" size="8" name="statorder_优秀人数" value=""></td>
                                           <td>优秀人数</td>                                       
                                       </tr>
                                       <tr>
                                           <td><input type="checkbox" name="stat_优秀分段" value='1'></td>
                                           <td><input type="text" size="8" name="statorder_优秀分段" value=""></td>
                                           <td>优秀分段  <input type="text" size="4" name="statrange_min_优秀分段" value="">~<input type="text" size="4" name="statrange_max_优秀分段" value=""></td>
                                       </tr>
                                        <tr>
                                           <td><input type="checkbox" name="stat_优秀率" value='1'></td>
                                           <td><input type="text" size="8" name="statorder_优秀率" value=""></td>
                                           <td>优秀率</td>                                       
                                       </tr>
                                       <tr>
                                           <td><input type="checkbox" name="stat_良好人数" value='1'></td>
                                           <td><input type="text" size="8" name="statorder_良好人数" value=""></td>
                                           <td>良好人数</td>                                       
                                       </tr>
                                       <tr>
                                           <td><input type="checkbox" name="stat_良好分段" value='1'></td>
                                           <td><input type="text" size="8" name="statorder_良好分段" value=""></td>
                                           <td>良好分段  <input type="text" size="4" name="statrange_min_良好分段" value="">~<input type="text" size="4" name="statrange_max_良好分段" value=""></td>
                                       </tr>
                                        <tr>
                                           <td><input type="checkbox" name="stat_良好率" value='1'></td>
                                           <td><input type="text" size="8" name="statorder_良好率" value=""></td>
                                           <td>良好率</td>                                       
                                       </tr>
                                       <tr>
                                           <td><input type="checkbox" name="stat_合格人数" value='1'></td>
                                           <td><input type="text" size="8" name="statorder_合格人数" value=""></td>
                                           <td>合格人数</td>                                       
                                       </tr>
                                       <tr>
                                           <td><input type="checkbox" name="stat_合格分段" value='1'></td>
                                           <td><input type="text" size="8" name="statorder_合格分段" value=""></td>
                                           <td>合格分段  <input type="text" size="4" name="statrange_min_合格分段" value="">~<input type="text" size="4" name="statrange_max_合格分段" value=""></td>
                                       </tr>
                                        <tr>
                                           <td><input type="checkbox" name="stat_合格率" value='1'></td>
                                           <td><input type="text" size="8" name="statorder_合格率" value=""></td>
                                           <td>合格率</td>                                       
                                       </tr>
                                       <tr>
                                           <td><input type="checkbox" name="stat_极差人数" value='1'></td>
                                           <td><input type="text" size="8" name="statorder_极差人数" value=""></td>
                                           <td>极差人数</td>                                       
                                       </tr>
                                       <tr>
                                           <td><input type="checkbox" name="stat_极差分段" value='1'></td>
                                           <td><input type="text" size="8" name="statorder_极差分段" value=""></td>
                                           <td>极差分段  <input type="text" size="4" name="statrange_min_极差分段" value="">~<input type="text" size="4" name="statrange_max_极差分段" value=""></td>
                                       </tr>
                                        <tr>
                                           <td><input type="checkbox" name="stat_极差率" value='1'></td>
                                           <td><input type="text" size="8" name="statorder_极差率" value=""></td>
                                           <td>极差率</td>                                       
                                       </tr>
                                 </table>
                          </div>
                          <div class="col-md-6 col-sm-6 col-xs-12">
                               <table class="table table-bordered" id="plue">
                                       <tr>
                                            <td>选择</td>
                                            <td>分数段</td>
                                            <td>最高分</td>
                                            <td>最低分</td>
                                            <td>是否启用比率</td>
                                       </tr>
                                </table>
                                <input type="button" name="xx" onclick="addNewRow();" value="添加分阶" />
                                <input type="button" name="yy" onclick="removeRow();" value="删除分阶" />
                          </div>
                          <div class="col-md-8 col-sm-12 col-xs-12" style="margin-top:20px;">
                               <label class="col-md-12 control-label"  style="padding:0">
							       分析行名称设置：
						       </label>
                               <table class="table table-bordered" id="jia">
                                       <tr>
                                            <td>选择</td>
                                            <td>项目</td>
                                            <td>名称</td>
                                       </tr>
                                </table>
                                <input type="button" name="xx" onclick="addRow();" value="增加" />
                                <input type="button" name="yy" onclick="moveRow();" value="删除" />
                          </div>
				      </div>
                      <div style="clear:both; height:30px;"></div>
                      <div class="form-group">
						  <label class="col-md-12 control-label"  style="padding:0">
							   考试复制：<span class="text-info">本学科本次考试统计表参数复制给其它考试。</span>
						  </label>
						  <div class="col-md-11  col-sm-offset-1  col-sm-11 col-xs-12">
						 		{%foreach from=$exam_lists key=key item=value%}
                                <label class="choice"><input type="checkbox" name="to_exam[]" value="{%$value.exam_id%}"> {%$value.exam_name%}</label>
								{%/foreach%}
                          </div>
                      </div>
                       <div class="form-group">
						  <label class="col-md-12 control-label"  style="padding:0">
							   学科复制：<span class="text-info">本学科参数复制给同年级其他学科。</span>
						  </label>
						 <div class="col-md-11  col-sm-offset-1  col-sm-11 col-xs-12">
						 		{%foreach from=$subject_lists key=key item=value%}
                                <label class="choice"><input type="checkbox" name="to_subject[]" value="{%$value.subject_id%}"> {%$value.subject_name%}</label>
								{%/foreach%}
                          </div>
                      </div>
                      <div class="form-group">
						  <label class="col-md-12 control-label"  style="padding:0">
							   年级复制：<span class="text-info">本年级各科参数复制给其他年级。</span>
						  </label>
						 <div class="col-md-11  col-sm-offset-1  col-sm-11 col-xs-12">
						 		{%foreach from=$grade_lists key=key item=value%}
                                <label class="choice"><input type="checkbox" name="to_grade[]" value="{%$value.grade_id%}"> {%$value.grade_name%}</label>
								{%/foreach%}
                          </div>
                      </div>
                    
				</div><!--box-body -->
                <div class="box-footer text-center">
                    <button type="submit" class="btn btn-primary ">  确 定</button>
                </div>
              </form>
           </div><!--box box-default box-solid-->
         </section>   
        </div><!--row-->
    </section>
 </div>
  <!--主要内容结束-->
{%include file="index.footer.tpl.php"%}

    <script language="javascript">
 //窗口表格增加一行
  function addNewRow(){
   var tabObj=document.getElementById("plue");//获取添加数据的表格
   var rowsNum = tabObj.rows.length;  //获取当前行数
   var colsNum=tabObj.rows[rowsNum-1].cells.length;//获取行的列数
   var myNewRow = tabObj.insertRow(rowsNum);//插入新行
   var newTdObj1=myNewRow.insertCell(0);
   newTdObj1.innerHTML="<input type='checkbox' name='chkArr' id='chkArr"+rowsNum+"' style='width:20px' />";
   var newTdObj2=myNewRow.insertCell(1);
   newTdObj2.innerHTML="<input type='text' name='range_name_"+rowsNum+"' id='nodecode"+rowsNum+"' style='width:70px' value='分数段"+rowsNum+"'/>";
   var newTdObj3=myNewRow.insertCell(2);
   newTdObj3.innerHTML="<input type='text' name='range_max_"+rowsNum+"' id='nodename"+rowsNum+"' style='width:80px' />";
   var newTdObj4=myNewRow.insertCell(3);
   newTdObj4.innerHTML="<input type='text' name='range_min_"+rowsNum+"' id='nodeper"+rowsNum+"' style='width:80px' />";
   var newTdObj5=myNewRow.insertCell(4);
   newTdObj5.innerHTML="<input type='checkbox' name='range_rate_"+rowsNum+"' value='1' />";
  }
//窗口表格删除一行
  function removeRow(){
   var chkObj=document.getElementsByName("chkArr");
   var tabObj=document.getElementById("plue");
   for(var k=0;k<chkObj.length;k++){
    if(chkObj[k].checked){
     tabObj.deleteRow(k+1);
     k=-1;
    }
   }
  }
    function addRow(){
   var tabObj=document.getElementById("jia");//获取添加数据的表格
   var rowsNum = tabObj.rows.length;  //获取当前行数
   var colsNum=tabObj.rows[rowsNum-1].cells.length;//获取行的列数
   var myNewRow = tabObj.insertRow(rowsNum);//插入新行
   var newTdObj1=myNewRow.insertCell(0);
   newTdObj1.innerHTML="<input type='checkbox' name='choe'  style='width:20px' />";
   var newTdObj2=myNewRow.insertCell(1);
   newTdObj2.innerHTML="<p>第"+rowsNum+"分析行名称</p>";
   var newTdObj3=myNewRow.insertCell(2);
   newTdObj3.innerHTML="<input type='text' name='note_"+rowsNum+"' id='nodename"+rowsNum+"' style='width:140px' />";

  }
//窗口表格删除一行
  function moveRow(){
   var chkObj=document.getElementsByName("choe");
   var tabObj=document.getElementById("jia");
   for(var k=0;k<chkObj.length;k++){
    if(chkObj[k].checked){
     tabObj.deleteRow(k+1);
     k=-1;
    }
   }
  }

</script>
</body>
</html>

